<!--
 * @Author: zheng yong tao
 * @Date: 2022-01-15 15:34:05
 * @LastEditors: zheng yong tao
 * @LastEditTime: 2022-01-27 00:54:56
 * @Description: 
-->
<template>
  <div>
    <article-list
      :allArticles="allArticles"
      @refreshData="initData"
    ></article-list>
  </div>
</template>

<script>
import articleList from "@/components/article/articleList.vue";
import { getBlogs } from "@/config/api";
export default {
  name: "homePage",
  components: {
    articleList
  },
  data() {
    return {
      allArticles: []
    };
  },
  mounted() {
    this.initData();
  },
  methods: {
    async initData() {
      const res = await this.httpGet(getBlogs, {});
      res.code == 1 ? (this.allArticles = res.data) : this.$message(res.msg);
    }
  },
  beforeDestroy() {}
};
</script>

<style lang="scss" scoped></style>
